package com.heima.admin.controller;

import com.heima.admin.annotation.OperationFill;
import com.heima.admin.service.IAdminLoginService;
import com.heima.model.admin.dtos.AdUserDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class AdminLoginController {

    @Autowired
    private IAdminLoginService adminLoginService;

    /**
     * 管理端用户登录
     * @param adUserDto
     * @return
     */
    @OperationFill
    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody AdUserDto adUserDto){
        log.info("收到管理端用户参数：{}",adUserDto);
        return adminLoginService.login(adUserDto);
    }

}
